<script setup>

import { ref, onMounted } from 'vue';
import axios from 'axios';

const seller = ref({
  email: '',
  sellerPhone: ''
  // 其他需要的字段
});

const fetchSellerInfo = async () => {
  try {
    const response = await axios.get('http://localhost:8080/sellers/1');
    seller.value = response.data; // 将返回的数据赋值给 seller
  } catch (error) {
    console.error('获取卖家信息失败:', error);
  }
};

// 在组件挂载时获取卖家信息
onMounted(fetchSellerInfo);

</script>



<template>
  <div class="help-center">
    <div class="help-center-card">
      <h2>帮助中心</h2>
      <p>在这里你可以联系卖家或者服务总平台解决相关问题</p>
      <ul>
        <li>
          <strong>如何联系商家</strong>
          <p>商家email:{{ seller.email }}</p>
          <p>商家电话:{{ seller.phoneNumber }}</p>
        </li>
        <li>
          <strong>如何找回密码？</strong>
          <p>您可以联系客服热线:10089</p>
        </li>
        <li>
          <strong>在此说明</strong>
          <p>平台仅可商家切换身份</p>
        </li>
        <li>
          <strong>如何加入平台成为卖家</strong>
          <p>您可以联系我们:000-123-456</p>
        </li>
      </ul>
    </div>
  </div>
</template>


<style scoped>
.help-center {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: #f9f9f9;
  min-height: 100vh;
}

.help-center-card {
  max-width: 600px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 20px;
  text-align: left;
}

.help-center h2 {
  font-size: 1.8em;
  color: #0073e6;
  margin-bottom: 15px;
}

.help-center p {
  font-size: 1em;
  margin-bottom: 15px;
}

.help-center ul {
  list-style-type: none;
  padding: 0;
  margin-top: 20px;
}

.help-center li {
  font-size: 1em;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #f1f5f9;
  border-radius: 8px;
}

.help-center li strong {
  color: #333;
}

.help-center li p {
  margin: 5px 0 0;
  font-size: 0.95em;
  color: #666;
}
</style>